/**
 * 
 */
package com.feib.stms.service;

import org.springframework.transaction.annotation.Transactional;

import com.feib.stms.model.User;
import com.feib.stms.model.UserLoginControl;

/**
 * @author Jimmy Liu
 *
 */
@Transactional(readOnly = true)
public interface UserLoginControlService {

	/**
	 * insert or update UserLoginControl table.
	 * @param userLoginControl
	 * @return
	 */
	@Transactional(readOnly = false)
	public int saveUserLoginControl(UserLoginControl userLoginControl);
	
	/**
	 * 使用者登出，需更新下列欄位 <br />
	 * <li>更新 actived = false</li>
	 * <li>更新 activityTime = now</li>
	 * @param userLoginControl
	 * @return
	 */
	@Transactional(readOnly = false)
	public int logout(UserLoginControl userLoginControl);

	/**
	 * 以使用者帳號(UserId)與群組代號(GroupNo)查詢
	 * @param user
	 * @return
	 */
	public UserLoginControl findByUerIdGroupNo(User user);

}
